<%@ page language="java" pageEncoding="UTF-8"%>

<script type="text/javascript">
var detailValidator;

function doSave() {
	if (!detailValidator.form()) {
		return;
	}
	
	block("#detailForm");
	$.ajax({
		type: "POST",
		url: "save.json",
		data: $("#detailForm").serialize(),
		dataType: "json",
		success: saveSucceedCallback,
		error:function(message){
			unblock("#detailForm");
			$.alert("出错了，错误信息为：\n"+message);
		}
	});
}


$(document).ready(function() {
	//$('#taskPlanStartDate').datepicker();
	$('#taskPlanEndDate').datepicker();
	$("textarea").tah({
		moreSpace:10
	});
	$().maxlength();
	
	detailValidator = $("#detailForm").validate({
		rules: {
			name:{required:true, maxlength:50 }
		},
		messages:{
			name:{required:"请输入模板名称"}
		}
	});

});
</script>

<form id="detailForm" class="form-horizontal">
<input type="hidden" id="id" name="id" />
<fieldset>
	<div class="control-group">
		<label for="name"  class="control-label">名称：</label>
		<div class="controls">
		<input type="text" id="name" name="name" maxlength="50" /> <span class="cms_color_required">*</span>
		</div>
	</div>
	<div class="control-group">
		<label for="content"  class="control-label">描述：</label>
		<div class="controls">
		<textarea id="content" name="content" maxlength="1000"></textarea>
		</div> 
	</div>
	<div class="form-actions">
		<a id="saveBtn" href="javascript:void(0);" class="btn btn-primary" onclick="doSave()"><i class="icon-ok"></i>保存</a>
	</div>
</fieldset>
</form>